import { Component, OnInit, Input } from '@angular/core';
/**
 * <app-no-data [type]="'text'"></app-no-data>
 * 属性type: 'text' | 'pie' | 'line' | 'bar'
 * 默认为 'text'
 */
@Component({
    selector: 'app-no-data',
    templateUrl: './no-data.component.html',
    styleUrls: ['./no-data.component.styl']
})
export class NoDataComponent implements OnInit {
    @Input() type: string; // 默认为text
    constructor() { }

    ngOnInit() {
        this.setImgType();
    }

    setImgType() {
        if (this.type && this.type.trim().length > 0) {
            return;
        } else {
            this.type = 'text';
        }
    }

}
